import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-product',
  templateUrl: './product.component.html',
  styleUrls: ['./product.component.css']
})
export class ProductComponent implements OnInit {
    private products: Array<Product>;
    private imgUrl = "http://placehold.it/320x150";

  constructor() { }

  ngOnInit() {
      this.products = [
          new Product(1, "first product", 1.99, 3.5, "this is the first product, when i learn angular in muke web platform", ["electrion"]),
          new Product(2, "second product", 2.99, 1.5, "this is the second product, when i learn angular in muke web platform", ["book"]),
          new Product(3, "third product", 3.99, 3, "this is the third product, when i learn angular in muke web platform", ["title"]),
          new Product(4, "forth product", 4.99, 2.5, "this is the forth product, when i learn angular in muke web platform", ["map"]),
          new Product(5, "fifth product", 5.99, 4.5, "this is the fifth product, when i learn angular in muke web platform", ["tree"]),
          new Product(6, "fixth product", 6.99, 5, "this is the fixth product, when i learn angular in muke web platform", ["fruit"])
      ]
  }

}

export class Product {
    constructor (
        public    id: number,
        public    title: string,
        public    price: number,
        public    rating: number,
        public    desc: string,
        public    categories: Array<string>
    ){ }
}
